﻿using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using SmartCity.Shared;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc;

namespace CommonManagement
{
    /// <summary>
    /// 区域控制器
    /// </summary>
    [RemoteService]
    [Area("commonManagement")]
    [Route("api/commonManagement/gps")]
    public class AreaController : AbpController, IAreaAppService
    {
        private readonly IAreaAppService _areaAppService;

        public AreaController(
            IAreaAppService areaAppService)
        {
            _areaAppService = areaAppService;
        }

        // 1.8.1 获取城市的区域
        [HttpGet]
        [Route("area")]
        public Task<ResultResponse<IList<AreaDto>>> ListAsync(string provinceName, string cityName, string name = null)
        {
            return _areaAppService.ListAsync(provinceName, cityName, name);
        }
    }
}